package com.twu.biblioteca.impl;

import com.twu.biblioteca.entity.User;

import java.util.ArrayList;
import java.util.List;

public class UserInfo {
    public boolean showUserInfo(String username) {
        boolean flag = false;

        List<User> userList = new ArrayList<User>(10);
        for(int i = 111; i < 119; i++)
        {
            User userTemp = new User();
            StringBuffer usernameTemp = new StringBuffer();
            usernameTemp.append(i).append("-1111");
            userTemp.setUsername(usernameTemp.toString());
            userTemp.setPassword("123");
            userTemp.setName("John");
            StringBuffer emailTemp = new StringBuffer();
            emailTemp.append(i).append("@gmail.com");
            userTemp.setEmail(emailTemp.toString());
            userTemp.setPhone(String.valueOf(i));
            userList.add(i-111, userTemp);
        }

        try {
            System.out.println("username:  " + username);
            System.out.println("password:  " + "123");
            System.out.println("real name: " + "John");
            System.out.println("email:     " + username.substring(0, 3) + "@gmail.com");
            System.out.println("phone:     " + username.substring(0, 3));

            flag = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }
}
